<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="app">
        <my-cpn></my-cpn>
        <local-component></local-component>
    </div>
    <script src="../js/vue.js"></script>
    <script>
        // const mycomponent = Vue.extend({
        //     template:`
        //         <div>我是一个组件</div>
        //     `
        // })
        // Vue.component('my-cpn',mycomponent)
        Vue.component('my-cpn',{
            template:`
            <div>我是一个组件</div>
            `
        })
        const localComponent = Vue.extend({
            template:`
                    <div>我是一个局部组件</div>
                `
        })
        const app = new Vue({
            el:'#app',
            data(){
                return {

                }
            },
            components:{
                // 'local-component':localComponent
                'local-component':{
                    template:`
                        <div>我是一个局部组件</div>
                    `
                }
            }
        })
    </script>
</body>
</html>